{% extends "profilebase.html" %}

{% block sidebar_title %}<h4>Your current schedule</h4>{% endblock %}

{% block sidebar_content %}
{% if sun %}
	<b>SUNDAY</b><br/><br/>
	{% for slot in sun %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% if mon %}
	<b>MONDAY</b><br/><br/>
	{% for slot in mon %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% if tue %}
	<b>TUESDAY</b><br/><br/>
	{% for slot in tue %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% if wed %}
	<b>WEDNESDAY</b><br/><br/>
	{% for slot in wed %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% if thurs %}
	<b>THURSDAY</b><br/><br/>
	{% for slot in thurs %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% if fri %}
	<b>FRIDAY</b><br/><br/>
	{% for slot in fri %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% if sat %}
	<b>SATURDAY</b><br/><br/>
	{% for slot in sat %}
		{{ slot.title }} 
		{% if slot.location %}
			@ {{ slot.location }}
		{% endif %}
		<br/>{{ slot.start }} - {{ slot.end }}<br/><br/>
	{% endfor %}
<hr />
{% endif %}
{% endblock %}

{% block main_title %}<h1>Add a slot to your schedule</h1>{% endblock %}

{% block main_subtitle %}{% endblock %}

{% block main_content %}
{% if success_slot %}
A new slot has been successfully added to your schedule<br/><br/>
<b>
{{ success_slot.title }}<br/>
{{ success_slot.day }} {{ success_slot.start }} - {{ success_slot.end }}
	{% if success_slot.location %}
		@ {{ success_slot.location }}
	{% endif %}<b/><br/><br/><br/>
{% endif %}

{% if error_message %}
<label style="color:#FF0000" >{{ error_message }}<br/><br/> 
<b>
{{ conflict_slot.title }}<br/>
{{ conflict_slot.day }} {{ conflict_slot.start }} - {{ conflict_slot.end }}
{% if conflict_slot.location %}
	@ {{ conflict_slot.location }}
{% endif %}</b>
</label><br/><br/><br/>
{% endif %}
<form name="slot_form" action="/myprofile/addSlot/" method="post">{% csrf_token %}
	{{ form.non_field_errors }}
	{% for field in form %}
		  <div class="fieldWrapper">
		{{ field.label_tag }}
		<label class="text" style="color:#FF0000" >{{ field.errors }}</label><br/>
		{{ field }}<br/><br/><br/>
		</div>
	{% endfor %}
	<input type="submit" id="search_btn" value="Add"/>
</form>
{% endblock %}
